# code = "sum([2 * 3 + 6, (5 - 9) + 7 - 2, 13 * 4 - 11])"
# print(eval(code))

# l = [11,22,33,44,55]
# print(sum(map(lambda item: item**2, l)))

# l = ['apple', 'banana', 'cherry', 'date']
# # print(list(filter(lambda item: len(item) <= 5, l)))
# print(sorted(l, key=lambda item:len(item)))

# data = [{ 'name': 'Alice', 'age': 25 },
#         { 'name': 'Bob', 'age': 30 },
#         { 'name': 'Charlie', 'age': 20 }]

# print(list(filter(lambda item: item['age'] >= 25, data)))
# print(list(filter(lambda item: item["name"].startswith("a") or item["name"].startswith("A"), data)))
# print(list(filter(lambda item: item["name"].lower().startswith("a"), data)))
# print(list(map(lambda x: x['name'], data)))
# print(list(map(lambda x: len(x['name']), data)))

def a():
    print("aaa")


def b():
    print("bbb")


def c():
    print("ccc")


def d():
    print("ddd")


def e():
    print("eee")


func_list = [a, b, c, d, e]
func_list[2]()

# 调用列表中第三个函数
func_dict = {
    "a": a,
    "b": b,
    "c": c,
    "d": d,
    "e": e,
}
# 调用字典中的d函数
func_dict.get("d")()

